Added isOptimizationEnabled() and test