Small fixes to query string parser