More bugfixes (unfinished)