Fix compilation with OSX and linux