Merge upstream fixes