MT#8633 Fix is_primary flag for primary numbers

(cherry picked from commit a6a2c1d8aeb40febf8db437a1bc51e539447ec31)