lots of bugfixes again