Fixed unregister validation logic.