Fix bugs and improve UI