Cleanup and fix the build error on Mac.