Fix OS X build, make #38 test more robust