Bug fixes, UI enhancements and code cleanups