Cleanups and working on unit tests.