Use the safe object in diag
Use vanilla method in in to_json to avoid method signature problems