Merged from upsteam