fixed #equals, renamed local vars and typos in test