Fix infinite loop

This should fix requests with failures. It also removes the code that stops requests that are lower than the one the server remembers; this may need to be uncommented (ln. 121) as well as vestigial code that randomly fails (marked with VESTIGIAL tag)