Fixed cmake error
Fixed build errors on Mac OS