Fixed bugs with buttons in gui.