Fix memory leak (#1)