optimize_kl: sanity check of input and minor stuff

Merged Philipp Arras requested to merge imports into NIFTy_8

Merge request reports