Various enhancements and corrections.