Bug fixes:

* Fixes #14
* Fixes #13
* Fixes #11