Fixing some equality bugs.
Merge pull request #10 from Wilfred/fix_equality

Fixing some equality bugs.