Syncing with vip

Noticed a small edge case bug in code that came down from VIP, fixed that and added tests.
I prefer to md5 hash arbitrary data used to generate keys as a matter of practice.