Fixed out of range string error in function is_match.