Cleanup of debug and fix tests