+ fix build error, fix memory leaks