Fix throwing of unknown and duplicate state errors and add tests.
Version 0.1.7.