Added some sanity checks for get_last_url().