Restore changes from eaa54126a70ea6b14b8e01e7e78fc66533fe6c65