[WIP] Progress on #187.
Fixes #187.