Fix bug where keys with multiple values were not being properly converted to query string