some fixes highlighted by ReSharper
Merge pull request #41 from denisstepanenko/ResharperFixes

some fixes highlighted by ReSharper