Fixed divide by zero issue