Fixed broken optimization.