Fix issues in registration