Bugfixes to make it play, and debug output