Merge pull request #1 from matter123/master

fix small undefined behavior
Patch previous 'fix', OS detection overriding support.