Fixed some deallocations