Fixing issue #3

First commit is tests that fail. Second commit is patch.