Applied diffs 837 and 838 from D274.