Minor performance improvements
Small corrections. Improved consistency. Fixed typos.