Proper deallocation routine.