Made some examples work.
Add tests