Memory leaks gefixed