Merge upstream changes from s1n4