Fix memory leak
Merged a trivial bug fix/memory leak