Fix json nesting issue, fixes #3323