small fixes in the registration logic