Added more unittests and cleaned examples.