Clean up HashTable constness and some related issues