Fix infinity loop when passing `all` argument.