Fixed some array incrementers and the program runs, but JSON files are
basically empty (only contain the headers, no actual data!)