Bugfixes

Resolved #8, #10, #11 and #12