Fixing a bug in registration.