Previously, the `queue` and `replace` arguments were leaking across loops even though they should be captured.