Partial revert of 77543b2 to sort query string values too