Resolve bugs in read_gmd_data()