! some bugfixes and cleanup