Validation

Fixes #176