bugfixes, cleaning