Fix divided by zero error