Fixed memory deallocation leak