Applied to upstream master (5.2.1). Thanks again Luis!
Gail Badner this is all ready to go for 5.2; please resolve/close after you decide what to do wrt 5.0/5.1. Thanks!