Fix issue with closing containers
* Wasn't clearing references properly.