Compilation fixes on OSX 10.8