Updated to clean up some unnecessary small allocations.