Merge "Add overflow prevention logic" into sc-dev