fix a potential problem in configure and fix the function chain_stage2
13 files changed