Fixup missing bits and OSX/Linux differences.