r23084: Merge Jeremy's fix for BUG 4637. This is now the final