1) Added a simple test scenario in which the naive solution is suboptimal.  Local optimization can't find the optimal solution, but global optimization can (after I tweaked it a bit)
2) Tweaked the objective function for global optimization so that it works with the simple test scenario
3) Fixed several bugs in the solver