Fixed bug in type checking of split (the order of arguments got mixed up
when the branches were not in the same order as in the data declaration).