Fix memory leak issue #1 (thanks @giffnyc !)