Improved error reporting

Change-Id: I8200939e70b4ca56b32f873cb9410d5c7839f377