Merge upstream code