Fixed compiling issues on Mac