Fix node leaks in test