Fixing memory leak.
Merge pull request #107 from ChrisGrant/performance

Fixing memory leak.