Fix JSON related encoding issue