Fixed a few bugs related to the registration