fixed writing out of surface maps