Fixed typecast issue in hash