As the previous poster said, you have to make sure that when you hide the corner in the top layer, that you don't accidentally bring a "good pair" into the top layer at the same time.
For example, let's say you were hiding the UFR corner with an R' move. When you do that the corner/edge pair in the RB slot will be placed into the top layer. So, you have to make sure that the RB slot is "empty" when you do that. If it's not, you need to rotate the U layer until you have an empty slot at RB.
I'd guess that's what your issue is. I hope that made sense.
Brian.