Fix type detection bug with long digit sequences