Throw errors on bad decoding of keys. Remove logging. Change "hash" to MAC.
Changed a few variable names, cleaned up some spacing.