Fixed typo in ensureCorrectDimensions