fixes #3534
rebased onto fadd34b5ca1ad8ee1ca255f7eb72842fcd0362bb
rebased onto ea58db21909e28b845c0b79d6291d8f43783bf75
rebased onto cb04b31879941330e1de2f1e992cdef5dc31846c
Jenkins seems stuck, tests are passing locally, so I'm going to merge as is.
Thanks!
Pull-Request has been merged by pingou
fixes #3534