Fix Firefox compatibility issues