Upstream

Merge upstream work into master.