Fixed a bug in output file name when url has a port number
Improved test suite