Fix bugs in ui