Fixed some mistakes, merged some changes

Fixed mocha tests referencing wrong object.

Fixed wrong issues URL

Added bugfixes discovered in a different project