How do you stop a whiney child?

I have a son who will be 7 and I am constantly having to correct how he talks to me.  It may be a middle child thing, or an attention getting antic but it is driving me nuts!  I have been reminding him to talk to me like he talks to his teacher, or to sound like a 7 year old, not a 2 year old.  Most of the time he will stop and start his comment or sentence all over sounding like the boy I know he is.  I am curious to know what other people have tried to get their child to stop sounding like a squeeky mouse.Please share your tips with me.  I think he is doing it out of pure habit now.  The challenge is to break that habit.