Fixing deprication warnings.

Monkey patching hash's key method even when it's defined is a bad idea.