Fix for BZ-1068662.
(cherry-picked from fb7d801)