bugfixes

bugfixes for last commit