Rate limit tweaks and an extra test
Relates to #154 (closed).
Relates to #386 (closed).
See individual commits. The last one is kind of unrelated, but I'm working on CI tunnel timeout issue and tinkered with tests a bit. It's worth keeping and not worth an extra MR.