Fixed bugs in gui, xml and directory