Sometimes I'll be talking with someone who will slip an "indirect" compliment into the conversation. Two examples:
(1) I was visiting my doctor for a somewhat "childish" (for lack of a better word) medical problem -- something that some people would associate with immaturity. At one point, we had this exchange:
Me: [Says something rather polite]
Doctor: You know, my [medical issue I'm there for] patients are always the most mature ones.
(2) This one is a little fuzzy and I might be misremembering, but it's still a good example. I was in my high school's computer programming club, and I was talking with the club adviser (who was also the only CS teacher at the school) about something I'd coded.
Me: It was a little easier than I thought it would be. [Note: This was only intended as a comment about my prediction of how hard it would be, not about my skill level.]
Adviser: [Smiling] Well, some people just have a natural gift for this sort of thing.
In both of these examples, I responded by laughing awkwardly, perhaps muttering "thanks", and looking around the room until the conversation rebooted. I feel that that was somewhat rude, as though I rejected their compliments. However, the only alternatives I see are:
(a) Accept the compliment as I would any other, with a phrase like "thanks, I try". This feels clumsy to me, because all the other person technically said was a neutral comment ("some people do this, some people do that") and I would be treating it like a comment about me in particular.
(b) Verbally acknowledge that "You have complimented me", and then move on to a normal reply to the compliment. This feels wrong as well, because stating "you have complimented me" (or worse, repeating a part of the compliment) would, I think, come off as bragging.
Should I have somehow acknowledged that the thing they said was intended as a compliment at me? If so, how? What is the gracious way to accept compliments like these?