Add validation checks

Closes #33.