Merge pull request #105 from ChrisGrant/master

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

Fixing memory leak.