validation OPTIMIZE set log nodes only before an error

Some logging improvements included.
diff --git a/tests/utests/data/test_parser_json.c b/tests/utests/data/test_parser_json.c
index b01dc53..0433832 100644
--- a/tests/utests/data/test_parser_json.c
+++ b/tests/utests/data/test_parser_json.c
@@ -558,7 +558,7 @@
     /* invalid metadata */
     data = "{\"@a:foo\":\"str\",\"@a:foo3\":1,\"a:foo3\":2}";
     PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
-            "Unknown module of node \"@a:foo\".", "Data location \"/@a:foo\".");
+            "Unknown module of node \"@a:foo\".", "Path \"/\".");
     CHECK_LOG_CTX("Missing JSON data instance to be coupled with @a:foo metadata.", "Data location \"/@a:foo\", line number 1.");
 
     /* empty name */