varous bugfixes detected during developement