Fixed issue when writing and a reference map type is a struct.