Fixed a divide by zero case