The solution for this seems simple enough, but I'm not sure exactly where it should be placed. In any case, here's a patch which may solve the problem. Offering it in hopes that someone more knowledgeable in this area can step in and apply the actual fix.