Fix for #861