Fix previous commit that only worked for one of the two cases.