Made the examples consistent with the documentation and fixed some typos.