Almost done with dll, need to fix memory leaks in both