bugfixes related with the source generation for hessian and reverse mode 2 with loops