bugfixes, more debug info