fixed mistakes in definition of split/mergefun