A use strpos for faster matching, double check template inclusion, correct mistake in checking for authority fields when removing duplicates, and a few changes to output messages / comments