Changes are made to allow non-sequential segment ID
Increase the max allowance of array size