Fixed some problems with number formatting