Fix bad coding in previous commit for #3802 (thanks @peller)