added ShufflePipe and fixed some issues regarding Pipeline generic casting.