Fixed a looping issue.