Some Mac OS X / Fink related fixes.

Hi Max,
please take a look at this and consider merging it / implementing something equivalent.