Backports change from the master branch