Fixing hashmap and better error reporting.
It should be possible to use javascript Object methods as keys.