Fixed a couple of bitesize bugs

Fixes Issue #45, #108 and #109