Fixed some typos, tweaks. PA3 output looks correct.
Minor code cleanup.