Various minor fixes and enhancements