Fixed NPE when a wrong url was specified.