bugfixes and hax