Fix a big where == were used instead of the correct Equals method
Code cleanup
Add a lot of tests