Fixed null pointer exception related to query strings.