Fix #8008 (v2)

Another attempt to do a minimal fix for #8008.

@pbrady 
@smichr