Switch cast in PairDStreamFunctions