Fixed compile error and warning on MacOSX.