All that maths came back to me- now a proper binary search, finally
Stop eating 301s inside the app's error handler