Applied patch from Frank Benkstein. If invalid hmac or cipher was specified