Tested for memory leaks.