Some fix and enhancements.