Fixed some typos and subtle errors on some generating functions.