More flexible validation

Fixes #17