Various changes; made iteration produce properly signed values