MODE-1920 Rebuild of a previous PR

DO NOT MERGE THIS PULL-REQUEST. It exists to help fix another.