Finally fix nasty loop issue.