Bug fixes.

Mostly Firefox and Safari fixes.