Added error checks and reporting.
Added error checks and reporting.

cesarmarinhorj/primarysources,dublebuble/primarysources,dublebuble/primarysources,cesarmarinhorj/primarysources,dublebuble/primarysources,cesarmarinhorj/primarysources,dublebuble/primarysources,cesarmarinhorj/primarysources