Fixing memory leak.

Fixes #106