Ildipo/jsonformat

Fix for bug #397