HALO: Fix memory leaks