Some fixes in chain.