Fixed a bug: incorrect authcredential validity checking.