Some minor typos.
Some minor rearrangement of code.