Test for duplicate definitions. Fix dependent aliases.