Fix file loading through a drag and fix dirty flag