Cleaned up how file references are handled.