Check base URL validity with new URI() instead of new URL() (fixes #184)