Cleanups before sync