Fix JSON not correctly retrieved in tests