OS X and a minor compile fix

See commit messages for each commit.