Change clean up functions. Prevents partial deletions.