fixed ApplyDiffOp to avoid errors with missing nodes