Bug fixed in deleting pointers.