Enable warnings-as-errors & fix compilation accordingly

CI -base is running, build succeeded, changes shouldn't influence test outcome.