Fixed bug loading from XML