Fix two issues pointed out in review of ticket #3870.