Fixing things, lots of debug printing