Free memory
Merge branch 'memory_fix'