Code Style and layout improvements. Introduced one bug.
Fixed bug with auto tokenization introduced with the code style refactoring. Other minor improvements.