Handling invalid keys.

- Fixes #5.