Fixing and adding more tests

Fixes #15
#16