Fixed a divide by zero error