Some minor fixes and enhancements