Fix exiting loop after hitting maximum identities.
Merge pull request #7 from Thynix/loop-break

Fix exiting loop after hitting maximum identities.