Fixed incorrect error message.
Added a couple more tests.