fixing #1868 Misc accumulated fixes

Added fixes to their new file locations and added a small fix for a failing test
Can this local optimizer not be moved after the definition of Solve to allow you to do local_optimizer([Solve])?

Also, add a test for this optimization