Reviewed r/1644
Patched bugs 1016977 and 1018128