Fix some problems on Linux and Mac.