Apply the patch provided by Leo van Kampenhout. (Port to 0.6.)