Fix some misc. Firefox compatibility bugs