Fix division by zero error