fix os detection for os x
Merge origin/master