bugfixes, cleanup and rename