Fix minor bugs in gui