Fixed division by zero for num < 10