bugfixes and stuff