Fix unit tests and remove unused imports