Improved MacOS X support (#42)