Various enhancements and fixes.