Fix backported from HEAD