Output better diagnostics on tojson