Implements #1298
Work on #1298