Add expr hashing test
Fix several major bugs