fixing unit tests and adding new ones