fix bugs of "extern"(added by guijun)