Clean up some memory issues