Added some tests and more fixes
Solved conflicts