Corrections for xml handling and session save