Revert "Revert "Improved clipping problem""

This reverts commit d2afdc795493eb9384ad546f707f68aa6936e11a.