Fix working on OSX and fatal error on unknown OS