Merge recent work from upstream