fixed inconsistency in d1 values when computing return flow functions - this is now always the d1 value of the caller