Fixed a bunch of bugs and stability issues with the UI.