Fixed the errors from the test files and small clean up