Firefox compatibility fixes