Reverted changes and merged from upstream/master