Add extern flag to some functions