Some more enhancements and fixes