Fix stray cleanup_gather and make slightly more efficient