Fix encoding of empty maps