Fix errors in registry.py