Added and fixed more Memory Management