Merge changes I2830eaed,Ie6375e67

* changes:
  Delete dead code
  Fix problems with allocation destruction