Revert "Taking care of some memory leaks"

This reverts commit d8adf041811c327a19ee88697799b8a607d9e5bd.