Fix potential loss of precision in expand hash.