Library: corrected query_uri_exists, more errors handled.
More errors handled.