(cherry picked from commit 0a2b109a3fe101e260b623d0768240ef8b7a47ae) Co-authored-by: Mark McDowall <mark@mcdowall.ca> Closes #975