Merge Artur's pull request and additional updates

Note that this reverts Artur's change to inclusive_scan's 2nd signature