Fix most compilation warnings for gcc, clang, release, debug.

Reviewers: @vinniefalco @HowardHinnant

There are still two warnings in gcc I can't puzzle out.