Further memory management fixes/bugfixes/improvement? Perhaps it is starting to actually work, idk.