Fixed divide by zero problem