Code cleanups
Merge pull request #3 from b333z/issue-1561-morefixes

Code cleanups