ENH: Adjoint optimisation fixes

Merged Vaggelis Papoutsis requested to merge adjointOptimisation-fixes into develop

A number of bug fixes and enhancements that didn't find their way to the main adjointOptimisation push

Merge request reports