fixed JIRA issue 5942 (division by zero)