Fix warnings and vulnerabilities