Fixed memory leaks
Merge pull request #7 from Dr15Jones/fixMemoryLeaks

Fixed memory leaks