Fixed a large bug in splitting the traces for preprocessing