cleaning up remaining memory issues