Misc. fixes and enhancements