Refs #24: take prim_seqno into consideration when remerge.
Merge branch 'gh24' into 3.x
Refs #24: fix for 3.x because of different function prototype