fixed foldRSeqNode and added tests for it