Misc improvements and fixes (agm_xmlViewer works now)