AUI-1027 Fix case of leading values matching next separator and add test cases to cover it