Fixed compiler errors for OS X builds.