Fix memory leak

Seems to fix #1