Show useful error if invalid input provided.

Fixes #22