Fix compile erros on Mac OS X