Immersing in a Mikveh:
One who is impure due to nocturnal emission [Keri], or any release of seed, may not visit a cemetery until he immerses in a Mikveh. [Many are particular to never visit a cemetery prior to immersing in a Mikveh even if they are not impure due to Keri. The Rebbe immersed in the Mikveh each time prior to visiting the Ohel of his father in-law. Many are accustomed to immerse in a Mikveh also after the visitation.]
 Alef Lamagen 581/109; Chayeh Adam 138/8; Kaf Hachaim 581/90; See M”A 559/15; Chikrei Minhagim p. 273
 One who visits the cemetery prior to immersion causes the Kelipos to cleave to him. [ibid]
 Pela Yoetz 9; Nimukei Orach Chaim 559/10; Custom of Chida, brought in Magal Tov p. 94; Igros Kodesh 24/263 [the Rebbe gave a directive to the asker to immerse prior to visiting the Ohel]; So is recorded of the Rebbe Rashab, upon visiting the Ohel of the Baal Shem Tov, that he searched for a Kosher Mikveh and immersed in it prior to the visitation. [Igros Kodesh Rayatz 6/280] See Igros Kodesh 9/301 that one is to immerse on the day he visits his father’s Kever.
 Chikrei Minhagim p. 274
 Moed Lechol Chaiy 12/4; Custom of Chida, brought in Magal Tov p. 94