Cleaned up backup and restore, allocate and deallocate.