Bug fix #7513 as suggested by Stephen Owens.