Merged in commits on trunk mentioned in comments 1-32 of #3134, plus r54059 not listed there; refs #3134