Fix bugs for number format exception