Several small enhancements and fixes