Hash fixes

@snicker Here's a copy of your changes with just the hash function fixes. I still need to figure out where it's choking on Python 3.3 but wanted to have you look over this to make sure you were happy with it.