Fixes #6039: correctly update the expected reports of modified nodes