improved number parsing and tests