fix bug in hash cache code, check that the result is a number.