Improvements to url validation