Fix an infinite loop affecting Firefox performance
Port over 1.2 release from legacy repository
Merging 1.2