Please verify that the keys have the proper lengths.  The AES key MUST be exactly 16 bytes.  The HMAC key MUST be at least as long as the AES key.