bugfixes and hacks