-Fixed off-by-one issue in clipping function.