Improvements detecting the url type
Fixed #3