Merged from upstream master