Work on #743; needs testing