Fix a bug when checking if the skeleton is to be deleted