fix issues on Mac.