Bug fixes, and UI improvements