Throw errors if required fields missing

To make it easier to find problems for developers.

Change-Id: I2671b50ff4731d9b8040c563b7b808ea15b964f7