Merge "Fix crash when quantizing" into sc-dev