Improve error reporting

Change-Id: Ia6db2bba5fe3b55c19041253febb11b448e4a569