Change warning flags to sane defaults and fix remaining warnings.