Adding more tests

More tests added and some fixes