[PATCH] Fix file lookup without ref