Fix divided by zero error in visualization