some important bugfixes