Fix Firefox bug after refactoring