Fix for minor code style and performance issues.