bugfixes

help from clintxs