minor bugfixes

Bug fixes.