turn on -Werror and fix resulting errors

@thomasgubler I ended up with a different result. I will try again and see if I just got confused tomorrow.