Fix quantity conversion simplification
Fix optimizer tests

bfgs went to hard-limit after the quantity conversion fix.
Also go nearer the minimum which speeds up the tests.
Add test for issue #212