*8996* Porting stats fixes

You might want to add test cases for urls with ports