Adding more tests and some examples and some small fixes