Fix bugs preventing adding updated cache entries to the name hash