minor:bugfixes, configurability and debug options