Fixed issues on OSX