Added tests. Fixed few minor issues found while writing tests.

Added tests. Fixed few minor issues found while writing tests.
Fixes #5 
@blaix :+1: and, even more than that, they care what API knock-on affects, fixing those bugs had.