Fix a bunch more memory leaks.. and prevent some NPE conditions