Fixes #3941
rebased onto 7d8bb74b30499e421340807b7d2db7eb339b9c4e
Would be nice to add some tests for this :)
I took over this PR in #3964 keeping the original commit and adding the desired test :)
Thanks for your help @akanksham !
Pull-Request has been closed by akanksham
Commit 679dedcd fixes this pull-request
Pull-Request has been merged by pingou
Fixes #3941