Added some Mac hacks

to make surface extraction and rendering work on Mac