Fixed wrong setting of optimality flag.