BUGFIX: actually pay attention to num_chains, num_iterations

also do cleanup