Include missing $document argument for firefox fix