fix a variety of xml round tripping (load->save->load) bugs