2 "bugs" solved in saving xml