Be consistent in your training

Dogs are happier, confident and secure in an environment where the rules and exceptions are consistent.
Owners that teach a dog that a behavior is acceptable sometimes, and then gets angry at the dog for the behavior at other times will almost always have a difficult time eliminating the problem.
Consistency is crucial in treating behavior problems because the problems that we want to eliminate (jumping, chewing, digging etc) are self-rewarding behaviors for the dog.
The dog will not want to miss out on an opportunity, if given one, to partake in them.