Fix a bug when restarting a chain.