Safe optimization.