Improved Error handling in LocateRegistry