Fixed problem with name loop at beginning, simplified comparisons.