Merge fixes and build error cleanup