Bugfixes

Closes GH-176