Fix to make /register/invite_code work - with test