some bugfixes and other stuff