Implement destructor and pop.