Fixed set global bug
fixed missing hashCode bug
cleaned up output to match go version