Merged from upstream repo