Fixed the ChainMapper and ChainReducer classes.