Added checks to prevent scripts from indexing a nill value when
scanning localhost.