More bugfixes, get rid of debug printing.