COMP: Fixed compile errors and warnings for Mac OS X.