Merge of various bug fixes dealing with mis-detection of BSD on OSX. Fix some documentation typos.