Fix compilation. Hopefully I broke nothing
Fix attempt for OS X