Added an objective function wrapper.