Fixed possible memory leak.