Fixed mem leaks, found by mshell.