Fixed crash and fixed the gui.