Improve handling of different criteria strings.