Minor bugfixes

Minor bugfixes