Fix compile issues on OSX with GCC