Fix errors found by VS2013 and MacOSX Clang.