Fix for BZ-1069788.
(cherry-picked from 286af6f)