Bug fixing in registration