More robust code for url construction.

Print usage if started without parameters.