some misc bugfixes