For ENG-4786, fixed assigning -1 to unsigned int.