bugfixes, minor extensions
cleanup