bunch of fixes around json compostion