Fix warnings and build