Add more tests and fix the examples