Better duplicate definitions check for functions.