made HMAC calculations work correctly;
added a little debug code