Merged from the latest upstream