Minor changes and optimizations.