Fixed memory leak
Merge pull request #431 from nkt/master

Fixed memory leak