Improved JSON error messages in tests.