Protect against stupid input. Fixes #4.