Fixed some minor mem leaks