lot of bugfixes