Hopefully fix some minor memleaks