Validate object constructor.

Closes #408.