Investigating and Addressing Hallucinations of LLMs in Tasks Involving Negation