Off-by-1 in query param removal