Fixed two memory leaks