Changed memory management - Still broken

Need to debug to see the cause of crashing still.