Merge "Add missing bounds checks" into sc-dev