AVALANCHE: Repair another bunch of memory leaks.