Fixed more minor memory leaks