Fixed to make it work under OSX