Pulled fix in from master branch

Oops, there was already a fix in master. Pulled it over to minimize
differences in branches.