Reimplement commit that was lost in 3.4 branch