Merge changes from upstream master.