Added modfied source files for OSX compilation