Fix warnings and treat warnings as errors