Added url_test, improved error reporting for invalid input.

Improved error reporting for invalid input.