Merge "Fix mismatched allocation/deallocation"