Some bug fixes and README.md