Deletion logic bug fixes