Fix the UUID autodetection code

Thanks for testing it, @knickers :heart: