Add some extra checks around version deletion