Query string and routing fixes