Cleanup and minor enhancements.