Improved error reporting

Change-Id: I5009693e67cb5ff2e172f6d05e253cffa36aaca8