Merging in upstream changes

Merging in changes from the upstream branch.