Fix domain validation

Fixes #24