Fixed possible issue when loading files in tests