Adding some tests and debug