Yeah, I have trouble with that sometimes. For instance, I have a couple of friends who are just monstrously filthy—to the point where I fear to go to their place or have them visit. I try to remind myself of their positive qualities, and only spend time with them in public or to my house for a very limited period. I guess it depends on what these negative habits are—how much do they actually affect you, rather than just grating on you?