Fixed build problems on MacOS X