Backport #15546 to 2014.1

This was a better fix than my recent fix.