Bugfixes

Resolve issues 11 and 12