Fix bug "division by zero"