Revert "Revert "Just Memory leaks left..""

This reverts commit 5631921f986501afd0cb6448f2d931d1aedcecc8.