Fixed comments from pull request #11

I fixed some mistakes left in the code since the last pull request. Also improved tests and fixed a bug occurring when using non-ascii chars in URL.