Simplify some of the logic for inverted strings.