Some cleanup of debug emitting code