Portability + logic on detection of HEAD
Merge pull request #9 from jddurand/master

Portability + log on HEAD detection