Fix static analysis tool warnings