fix minimization issue

in some (very) rare case the minimiser reaches its max_iter
iterations count but is not able to return to a previously found minimum.
In this case we just give up and return an error message.
Merge branch 'develop' of /home/saladin/Src/ptools into develop