Added tests

A lot of tests fails due to bugs