Fixing no use before define issues
Merge pull request #281 from ilyavolodin/no-use-before-define

Fixing no use before define issues (Fixes #280)