Bugfix generating next hash.