Updated README and fixed code errors in doc.