Fixed code generation bug.
Use custom hasher and comparer to make the unordered_map more predictable (instead of hashing pointers which is totally random).