some bugfixes & clean ups

some bugfixes & clean ups