Add tests and adjust incomplete things