Fix a few osx/gnu incompatibilities