Bugfix for RT#439785; correct divide by zero error