Fix warning about strcasestr being undeclared; remove unused variable