Move and fix debug output