Added modifications for Mac OS compiling