Fixed some issues to be able to use the library on Mac OS X.