r3381: More merging of the #1717 patch. Fixup some erroneous assumptions about