Added clipping detection and prevention