Working on memory leaks and bugs