Fixed various bugs, especially controls and UI