Fixed a few compiler warnings and compilation on OS X