Bugfixing

Fixed some bugs in main.
Edited link in readme.md