fixed ApplyDiffOp to avoid errors with missing nodes

fixes #687