Fix possible memory leak #3