Fix validation of required fields (fixes #300)

Regression in b5b0272.