Fixed compiler errors for OS X.