Fix for BZ-1090399.
(cherry-picked from f8cd333)