Fixed some bugs in GUI