This looks like a good fix, should we try having tests for it?
@pingou I couldn't reproduce it in the tests, which is how the bug got to master. If it's that important to you, I can keep trying to reproduce it in the tests, but in my opinion it is not worth the time investment.
rebased
@pingou I've figured out how to reproduce it through the tests and added a test in the latest rebase.
Thanks! :)