Fixing some bugs in gui interface.