more changes and bugfixes