Better error on invalid map keys.

Closes #25.