Fixed hasSuffix and hasPrefix behavior