read map codes, and correct mapcode header