Revert regressions introduced by commit d193913b70712715929813b388267504577d7b75