Added some inline comments to document Darwin/OSX-specific logic.