Fix objective function