Fixed hash/unhash

Minor bugfixes to get !hash working correctly.