Land a part of bug 1061023 which was missed

--HG--
extra : rebase_source : c120c957eba6f9acda395e5b5880dfc3414db4dd
Land a part of bug 1060987 which was missed

--HG--
extra : rebase_source : 38566ee356e3d0b94cef584284587a72e81d6114