fix NPE — url could be in any form, so, parsed can be null
(cherry picked from commit ec22c2e)
fix Url equality (scheme)
(cherry picked from commit e668634)