upstream merge fixes