Fixed a few bugs. Updated the readme.