Fixed clamping bug