Issues 4904 and 4855

Two small fixes. 

r? @catamorphism