Fix some issues on Darwin.