Fix allocation/deallocation.