Fix nan/inf while pinching