diff --git a/traits/PasswordTrait.php b/traits/PasswordTrait.php
index <HASH>..<HASH> 100644
--- a/traits/PasswordTrait.php
+++ b/traits/PasswordTrait.php
@@ -191,6 +191,8 @@ trait PasswordTrait
 
     /**
      * Set new password.
+     * If $password is empty, the specilty which represents the empty will be taken.
+     * Finally, it will trigger `static::$eventAfterSetPassword` event.
      * @param string $password the new password to be set.
      */
     public function setPassword($password = null)
diff --git a/traits/RegistrationTrait.php b/traits/RegistrationTrait.php
index <HASH>..<HASH> 100644
--- a/traits/RegistrationTrait.php
+++ b/traits/RegistrationTrait.php
@@ -113,7 +113,7 @@ trait RegistrationTrait
             if (!$this->save()) {
                 throw new IntegrityException('Registration Error(s) Occured: User Save Failed.', $this->getErrors());
             }
-            if ($authManager = $this->getAuthManager() && !empty($authRoles)) {
+            if (($authManager = $this->getAuthManager()) && !empty($authRoles)) {
                 if (is_string($authRoles) || $authRoles instanceof Role || !is_array($authRoles)) {
                     $authRoles = [$authRoles];
                 }
fix registring with roles bug.