Fix bug in mac and windows detection