Added debug message on json writer + tests