Changed the order of the writeJSON arguments so they work better with UFCS.