Fixed some bugs and UI glitches