Added encoding for map items.