Fixed bug in loading/saving chains.