Cleanup of debug code