Minor bug fixes and performance enhancements.