fixes to the first order forward mode with loops