Addressed memory leaks in unit tests