Fix minor bugs and debug left-overs.