fixed minor reported memory leaks.