Fixes some issues with jsonfile write/read Upstream-commit: 11b4c89087cb7d6014e6106521ebb92fa74d01ab Component: engine