Better fix for issue #2257.