Minor enhancements and code cleanup