Various bug fixes and usability improvements