resolving some invalids reads/writes, remaining memory leaks (Glist ?)