fix static analysis errors/warnings