Fix bugs. Passed Firefox browser test