Fix rehash bug