Removed obsolete tests that are no longer working.
Added conditional to string substitution, since Perl's strict rule enforcement would (wrongly) complain about a possibly uninitialized variable.
Removed quotation marks that would have prevended the return of "hits" in the case when no "id" could be determined. Showed up as a warning via Perl's strict rule enforcement. #1006