bugfixes after commit c6b1faa1ca9b7877be7e74b10ccb518dcab8fe18