Add tests and correct all remarks