Make fitting more robust