Fixed debug printing and reset writing to JSON like normal.