Fix warnings
Some of these warnings may not ever happen in practice because people don't enable all possible warnings, but it still makes sense to fix them.
This PR will likely conflict with !4 (merged). If this is merged first I would do all work to rebase.
Edited by Povilas Kanapickas