This patch supercedes my patch from 1307142188-6551-1-git-send-email-dkg at fifthhorseman.net , and provides what appears to be a much cleaner approach to achieve the same result. --dkg