Add Mac OSX support. Doesnt work for all the samples.