Fix rare bug preventing the correct root path from being found