Apply patch from 4da836f251fad76eb9cd3c0ed6a7bb60289ebf42.