Fix optimization error