Fix bugs that causes fails to access global configs.