EAGLESIX-2700 Added a method to allow the optimizer to work much better. Improved test cases.