Fixed minor bug and changed MAX_REGISTRATION_ATTEMPTS to 30

Change-Id: I0fc79fb6b6e4ef8d0bc6bee68e62f58cda21cc5e