Fixes some bugs with authorizations and registering.