Gh2836 resolve merge conflict

Rebased and resolved merge conflict of #2836.

(Is the correct thing to do here to set up a new branch? I wasn't brave enough to try and force directly to the pr...)