added more error checking/reporting

Change-Id: I85222b2b6ae98d7114b0b0f2922a4ba7823ae181