Add README.md.
Fix some bugs.