Fix from Vikram Garg for adjoint_advance_timestep