Revert broken cleanup code