fixing unit tests and some formatting issues