Fix issue #1 (incorrect iteration) and issue #1 (typo)