Fix a bunch of static analysis warnings