a bunch of static analysis cleanup