Don't iterate over head attribute twice Fixes #401