Fix malformed URI error in splitKeyValuePairs