Merge with upstream and adapt mod