Fixed the unit tests in code formatting and literate tests , cleaned up a couple of things