BUG: fixed several bugs. Still some work to do (see TODO).
BUG: fixed several bugs. Still some work to do (see TODO).

Former-commit-id: 47d79c94f46d5f01791fbe6e48e58fccdbe46e7d
Former-commit-id: de1eafa623275aa08c998cb90ff4bb2ff14cf191
3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox