Fixed several errors in the pseudocode and typos here and
there.