Misc fixes and enhancements