Fixing objective function.