fix bug 1057012, 1079882

Replaces #2778
Bah, nvm. Didn't see the 2nd argument.