Fix typos in manpage/examples. Cosmetical code rearrangements