Fix registry bug