Use clamp inline function for some more operations