Fixed some bugs and updated readme.