Revert "Revert "Merge pull request #1 from sqnoc/patch-1""

This reverts commit cc2c36aee6a76ea754eff26ba62ea3ce7066ec1e.
Change variable type
Fix build, remove commented stuff