partial solution to #1032