Better error checking & reporting.