Make clamp implementation more similar to extent