debug make target; fix memleak