Fixed issues with file referencing