Fixed crash when canceling wrap operation