Improved number parsing