[FIXED] Misc bugfixes & cleaning