Fixes #4436
rebased onto c6681d20ba35822cd2d2479173b9a42d374b9029
Since this isn't covered in the tests, I'm going to merge this directly :)
Pull-Request has been merged by pingou
Fixes #4436