Merge pull request #253 from iains/darwin-build

Some Darwin build fixes