Minor code style and performance optimizations.