Fix some issues in hash extraction