Fix conditions in `canRemoveExpectation`.