Fix file referencing bug