upstream changes from thlg