to_json serialises inconsistently.