Osx fixes

These are all the changes necessary to build on Yosemite (OSX 10.10)
Perhaps using NSAlert here would be better, as it would be more visible to the user than just printing to the console.