Fixes compiler errors and warnings on Mac OS X compile
Merge pull request #154 from asmaloney/fix_compiler_err_and_warn

Fixes compiler errors and warnings on Mac OS X compile