Well I've moved it json_encode for now. But it's easy to remove that commit if others feel strongly about this!