Fixed bugs in GUI