Cleanup of the linking to avoid problems on Mac