Fixed some gui bugs caused by last commit