Really fixed potential memory leaks