Throw exception properly

Change-Id: I6d3c8f529bb2d288d82fc7c244001f5fc51c2610