Use references instead of cloning when encoding table.