Bug fixes and correction of typos.