Revert "Less memory leaks"

This reverts commit e5fc00412883ad383d2af8decb7530318ab7985e.