Bugfixes

Fixes some minor bugs