Lots of little bug fixes and changes (add/edit dont break xml file now)