Added some unit tests, fixes #19