Cleanup and fixed some generics issues in HashFunctions hierarchy