Fixed JSON reading (still needs testing, work)