Fix broken tags and identities with spaces