r24667: Finally merge the registry improvements that Wilco Baan Hofman and I have