bugfixes for compilation