Fixes crash in Model::scaleToFit()