Changes to BaseOptimization and inheritance to control N of observations used in optimization.