Work on #1257; needs testing