Improve GetHashCode implementations

Fixes issue #217
Remove unused type