Fixed an error trying to change hostname to lowercase when a URL could not be parsed