Overnight changes and cosmetic fixes.

Because I cant push or make pull requests unless it is my repository.
Merge pull request #1 from egurnov/master

Final Version